import request from '@/utils/request'

// 获取缴费列表
export function getPaymentList(businessId, searchName, payTypeId, startDate, endDate, perPage, page) {
  const data = { businessId, searchName, payTypeId, startDate, endDate, perPage, page }
  return request({
    url: 'api/v1/backend/pay_the_fees',
    method: 'post',
    data
  })
}

// 提交新增缴费列表
export function submitPaymentInfo(
  businessPayTheFeesMessageDetailId,
  payTheFeesTime,
  actionUserName,
  receiptMessage,
  receiptImage
){
  const data = {
    businessPayTheFeesMessageDetailId,
    payTheFeesTime,
    actionUserName,
    receiptMessage,
    receiptImage
  }
  return request({
    url: 'api/v1/backend/pay_the_fees/add',
    method: 'post',
    data
  })
}

// 查看缴费列表详情
export function getDetailPayment(businessPayTheFeesId){
  const data = { businessPayTheFeesId }
  return request ({
    url: 'api/v1/backend/pay_the_fees/info',
    method: 'post',
    data
  })
}

// 删除缴费列表
export function getDeletePayment(businessPayTheFeesId) {
  const data = { businessPayTheFeesId }
  return request({
    url: 'api/v1/backend/pay_the_fees/del',
    method: 'post',
    data
  })
}

// 获取缴费通知汇总列表
export function getPaymentNoticeSumList(searchName, payTypeId, startDate, endDate, perPage, page){
  const data = {
    searchName, payTypeId, startDate, endDate, perPage, page
   }
  return request({
    url: 'api/v1/backend/pay_the_fees_message',
    method: 'post',
    data
  })
}

// 提交新增缴费通知
export function submitPaymentNoticeSum(content, startDate, endDate, marketAccountId, marketAccountName, payTypeId, sendType, businessDataList, sendRange, appointMoney) {
  const data = {
    content, startDate, endDate, marketAccountId, marketAccountName, payTypeId, sendType, businessDataList, sendRange, appointMoney,
   }
  return request({
    url: 'api/v1/backend/pay_the_fees_message/add',
    method: 'post',
    data
  })
}

// 删除缴费通知汇总
export function getDeletePNSum(businessPayTheFeesMessageId) {
  const data = { businessPayTheFeesMessageId }
  return request({
    url: 'api/v1/backend/pay_the_fees_message/del',
    method: 'post',
    data
  })
}

// 获取缴费通知列表
export function getPaymentNoticeList(searchName, businessPayTheFeesMessageId, payStatus, payTypeId, perPage, page){
  const data = { searchName, businessPayTheFeesMessageId, payStatus, payTypeId, perPage, page }
  return request({
    url: 'api/v1/backend/pay_the_fees_message/list',
    method: 'post',
    data
  })
}

// 删除缴费通知
export function getDeletePNotice(businessPayTheFeesMessageDetailId) {
  const data = { businessPayTheFeesMessageDetailId }
  return request({
    url: 'api/v1/backend/pay_the_fees_message/del',
    method: 'post',
    data
  })
}

// 获取缴费状态 已缴 未缴
export function fetchPayStatus() {
  const data = { differentFlag : "pay_the_fees_pay_status" }
  return request({
    url: 'api/v1/backend/public/different',
    method: 'post',
    data
  })
}

// 获取缴费类型 电费 水费 房租 垃圾费 等等
export function fetchPayClazz() {
  return request({
    url: '/api/v1/backend/public/paymentTypes',
    method: 'post'
  })
}
